import {goodsdetail} from "../../utils/api"
export const state={
    list:[],
}

export const mutations={
    changegoodsdetail(state,obj){
        state.list=obj
    }
}

export const actions={
    reqGoodsDetail(context,obj){
        goodsdetail(obj).then(res=>{
            let arr=res.data.list[0]?res.data.list[0]:[]
            context.commit("changegoodsdetail",arr)
        })
    }
}

export const getters={
    list(state){
    return state.list
    }
}

export default {
    state,
    actions,
    mutations,
    getters,
    namespaced:true,
}